﻿using System;
using System.Collections.Generic;
using System.IO;
using System.Collections;
using System.Text;
using System.Xml;

namespace Pavilion
{
    public delegate void NameChangedDelegate(string oldName, string newName);
    public abstract class ResourceBase
    {
        public event NameChangedDelegate NameChanged;

        private string _name;
        public string Name
        {
            get { return _name; }
            set
            {
                if (_name == value)
                    return;

                string oldName = _name;
                _name = value;

                OnNameChanged(oldName, _name);
            }
        }
       
        private void OnNameChanged(string oldName, string newName)
        {
            if (NameChanged != null)
                NameChanged(oldName, newName);
        }

        public abstract string ResourcePath { get; }
        public abstract void Dispose();
    }
}
